from flask import Flask
from flask_cors import CORS
from login import app_login
from login_test import app_login_test
from company import app_company
from weixin_openid import app_get_openid
from weixin_pay import app_weixin_pay
from particular_authority import app_particular_authority
app = Flask(__name__)

CORS(app)#跨域

app.register_blueprint(app_login, url_prefix = '/api/v2')#登录app
app.register_blueprint(app_login_test, url_prefix = '/api/v2')#检测登录接口
app.register_blueprint(app_company, url_prefix = '/api/v2')#数据库接口
app.register_blueprint(app_get_openid, url_prefix = '/api/v2')#获取微信openid
app.register_blueprint(app_weixin_pay, url_prefix = '/')#微信支付接口
app.register_blueprint(app_particular_authority, url_prefix = '/api/v2/')#检测是否付费




@app.route('/api/v2/help')

def v2_help():

    info = '''

    <br><br><br><br>

    <a href = '/instructions/company.md'>company_api说明</a>

    <br><br><br><br>
    <a href = '/instructions/login.md'>api_login说明</a>
    <br><br><br><br>

    <a href = '/instructions/login_test.md'>api_login_test说明</a>

    '''

    return info


if __name__ == '__main__':
    print(app.url_map)
    # app.run(debug = True, host = '0.0.0.0', port = '5001')
    app.run(debug = True)
    